import request from '@/utils/request';
import type { AxiosPromise } from 'axios';
import type {DetailVo, MallGoodsVO} from "@/api/home/mallGoods/types.ts";
import type {RouteParamValue} from "vue-router";

/**
 * TODO 根据sku查询商品列表列表,暂时不用
 * @param query
 * @returns {*}
 */

export const getSkuGoodsListApi = (query?: any): AxiosPromise<MallGoodsVO[]> => {
  return request({
    url: '/api/mall/goods/sku',
    method: 'get',
    params: query
  });
};
/**
 * 查询商品列表详细
 * @param id
 */
export const getGoodDetailApi = (id: string | RouteParamValue[]): AxiosPromise<DetailVo> => {
  return request({
    url: '/api/mall/goods/detail/' + id,
    method: 'get'
  });
};
/* TODO 这里到时需要修改*/
export const getGoodsListApi = (query?: any): AxiosPromise<MallGoodsVO[]> => {
  return request({
    url: '/api/mall/goods/list',
    method: 'get',
    params: query
  });
};